#ifndef PL_ADDITEM_H
#define PL_ADDITEM_H

#include <head/g_pch.h>
#include <head/m_message.h>
#include <head/db_helper.h>
#include "m_fhs.h"

namespace Ui {
class PL_AddItem;
}

class PL_AddItem : public QDialog
{
    Q_OBJECT

public:
    explicit PL_AddItem(QWidget *parent = nullptr);
    ~PL_AddItem();

    void updateCategory();
    void setCategory(const QString &category);

    bool addItem(const QString &category,const QString &label,
                 const QString &model,const QString &material,
                 double number,double price,double total,
                 const QString &url,const QString &remark);

    void setItem(const QString &category,const QString &label,
                 const QString &model,const QString &material,
                 const QString &url);

private slots:
    void on_categories_currentTextChanged(const QString &text);
    void on_btn_copy_clicked();
    void on_btn_submit_clicked();
    void on_price_editingFinished();

private:
    Ui::PL_AddItem *ui;

    QString table;
};

#endif // PL_ADDITEM_H
